#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

MODULE_AUTHOR("ex2");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("ex2");

#ifdef EX2
void run_ex2(void)
{
    printk(KERN_INFO "EX2: run_ex2\n");
}
#endif

static int __init hello_init(void)
{
    printk(KERN_INFO "EX2: Hello World!\n");
#ifdef EX2
    run_ex2();
#endif
    return 0;
}

#ifdef DEBUG
#define DEBUG_FLAG "DEBUG"
#endif

static void __exit hello_exit(void)
{
#ifdef DEBUG
    printk(KERN_INFO "EX2: good bye! %s\n", DEBUG_FLAG);
#else
    printk(KERN_INFO "EX2: good bye!\n");
#endif
}

module_init(hello_init)
module_exit(hello_exit)
